package com.design_pattern._03_behavioral._06_observer;

import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class TestDriver {

    public static void main(String[] args) {
        MumObserer mumObserer = new MumObserer();
        DadObserer dadObserer = new DadObserer();

        BabyObservable babyObservable = new BabyObservable();
        babyObservable.addObserver(mumObserer);
        babyObservable.addObserver(dadObserer);

        Baby baby1 = new Baby();
        Baby baby2 = new Baby(); // 测试使用
        babyObservable.cry(baby1,"孩子开始哭了");
        babyObservable.cry(baby2,"孩子不哭了");
    }
}
